namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;
    using Jumpton.SFA.Server.Entity;


    [System.SerializableAttribute()]
    [Map("DISCOUNTS")]
    public class DISCOUNTS : ObjectRow
    {

        public DISCOUNTS()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public DISCOUNTS(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected DISCOUNTS(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("DESCRIPTION")]
        public string DESCRIPTION
        {
            get
            {
                return (System.String)GetValue("DESCRIPTION");
            }
            set
            {
                SetValue("DESCRIPTION", value);
            }
        }

        [Field("TYPE")]
        public decimal TYPE
        {
            get
            {
                return (System.Decimal)GetValue("TYPE");
            }
            set
            {
                SetValue("TYPE", value);
            }
        }


        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public long LAST_UPDATE_TIME
        {
            get
            {
                return (long)GetValue("LAST_UPDATE_TIME", DateTime.Now);
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("CREATE_TIME")]
        public long CREATETIME
        {
            get
            {
                return (long)GetValue("CREATETIME", DateTime.Now);
            }
            set
            {
                SetValue("CREATETIME", value);
            }
        }

        [Field("ACTIVE")]
        public Boolean ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE", false);
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("CHECK_LEVELS")]
        public string CHECKLEVELS
        {
            get
            {
                return (System.String)GetValue("CHECKLEVELS");
            }
            set
            {
                SetValue("CHECKLEVELS", value);
            }
        }

        [Field("LEVELS_UOM")]
        public string LEVELSUOM
        {
            get
            {
                return (System.String)GetValue("LEVELSUOM");
            }
            set
            {
                SetValue("LEVELSUOM", value);
            }
        }

       

        [Field("LEVEL_1")]
        public decimal LEVEL1
        {
            get
            {
                return (System.Decimal)GetValue("LEVEL1");
            }
            set
            {
                SetValue("LEVEL1", value);
            }
        }

        [Field("DISCOUNT_1")]
        public decimal DISCOUNT1
        {
            get
            {
                return (System.Decimal)GetValue("DISCOUNT1");
            }
            set
            {
                SetValue("DISCOUNT1", value);
            }
        }

        [Field("LEVEL_2")]
        public decimal LEVEL2
        {
            get
            {
                return (System.Decimal)GetValue("LEVEL2");
            }
            set
            {
                SetValue("LEVEL2", value);
            }
        }

        [Field("DISCOUNT_2")]
        public decimal DISCOUNT2
        {
            get
            {
                return (System.Decimal)GetValue("DISCOUNT2");
            }
            set
            {
                SetValue("DISCOUNT2", value);
            }
        }

        [Field("LEVEL_3")]
        public decimal LEVEL3
        {
            get
            {
                return (System.Decimal)GetValue("LEVEL3");
            }
            set
            {
                SetValue("LEVEL3", value);
            }
        }

        [Field("DISCOUNT_3")]
        public decimal DISCOUNT3
        {
            get
            {
                return (System.Decimal)GetValue("DISCOUNT3");
            }
            set
            {
                SetValue("DISCOUNT3", value);
            }
        }

        [Field("LEVEL_4")]
        public decimal LEVEL4
        {
            get
            {
                return (System.Decimal)GetValue("LEVEL4");
            }
            set
            {
                SetValue("LEVEL4", value);
            }
        }

        [Field("DISCOUNT_4")]
        public decimal DISCOUNT4
        {
            get
            {
                return (System.Decimal)GetValue("DISCOUNT4");
            }
            set
            {
                SetValue("DISCOUNT4", value);
            }
        }

        [Field("SAP_DISC_CODE")]
        public string SAPDISCCODE
        {
            get
            {
                return (System.String)GetValue("SAPDISCCODE");
            }
            set
            {
                SetValue("SAPDISCCODE", value);
            }
        }

        [Field("DOMAIN_ID")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

       
      

       


        [CalculateField]
        public bool IsCheck
        {
            get
            {
                return (System.String)GetValue("CHECKLEVELS") == "1" ? true : false;
            }
        }
    }
}
